package cn.iocoder.yudao.module.bpm.message.local;

import cn.iocoder.yudao.module.bpm.message.ProcessTaskMessage;
import cn.iocoder.yudao.module.bpm.message.handle.ProcessInstanceMessageHandle;
import cn.iocoder.yudao.module.bpm.message.handle.ProcessTaskMessageHandle;
import cn.iocoder.yudao.module.bpm.message.dto.BpmProcessTaskAssignedMessage;
import cn.iocoder.yudao.module.bpm.message.dto.BpmProcessTaskCancelledMessage;
import cn.iocoder.yudao.module.bpm.message.dto.BpmProcessTaskCompletedMessage;
import cn.iocoder.yudao.module.bpm.message.dto.BpmProcessTaskCreatedMessage;
import lombok.extern.log4j.Log4j2;

@Log4j2
public class LocalProcessTaskMessage implements ProcessTaskMessage {


    private final ProcessInstanceMessageHandle processInstanceMessageHandle;

    private final ProcessTaskMessageHandle processTaskMessageHandle;

    public LocalProcessTaskMessage(
            ProcessInstanceMessageHandle processInstanceMessageHandle,
            ProcessTaskMessageHandle processTaskMessageHandle

    ) {
        this.processInstanceMessageHandle = processInstanceMessageHandle;
        this.processTaskMessageHandle = processTaskMessageHandle;
    }

    @Override
    public void onProcessInstanceTaskCreatedMsg(BpmProcessTaskCreatedMessage bpmProcessTaskCreatedMessage) {
        processTaskMessageHandle.onProcessInstanceTaskCreatedMsg(bpmProcessTaskCreatedMessage);
    }

    @Override
    public void onProcessInstanceTaskAssignedMsg(BpmProcessTaskAssignedMessage bpmProcessTaskAssignedMessage) {
        processTaskMessageHandle.onProcessInstanceTaskAssignedMsg(bpmProcessTaskAssignedMessage);
    }

    @Override
    public void onProcessInstanceTaskCleanMsg(BpmProcessTaskCancelledMessage bpmProcessTaskCancelledMessage) {
        processTaskMessageHandle.onProcessInstanceTaskCleanMsg(bpmProcessTaskCancelledMessage);
    }

    @Override
    public void onProcessInstanceTaskFinishedMsg(BpmProcessTaskCompletedMessage bpmProcessTaskCompletedMessage) {
        processTaskMessageHandle.onProcessInstanceTaskFinishedMsg(bpmProcessTaskCompletedMessage);
    }
}
